enum Keys {
  UserInfo = 'userInfo',
  SearchExtra = 'searchExtra',
  SearchFamily = 'searchFamily'
}
//session清空
export const cleanSession = () => {
  sessionStorage.clear()
}

//存储userInfo 用户信息到session
export const setUserInfo = (userInfo: string) => {
  sessionStorage.setItem(Keys.UserInfo, userInfo)
}
export const getUserInfo = () => {
  return sessionStorage.getItem(Keys.UserInfo)
}
//存储搜索条件
export const setSearchExtra = (searchExtra: string) => {
  sessionStorage.setItem(Keys.SearchExtra, searchExtra)
}
export const getSearchExtra = () => {
  return sessionStorage.getItem(Keys.SearchExtra)
}
export const removeSearchExtra = () => {
  return sessionStorage.removeItem(Keys.SearchExtra)
}

export const setSearchFamily = (searchFamily: string) => {
  sessionStorage.setItem(Keys.SearchFamily, searchFamily)
}
export const getSearchFamily = () => {
  return sessionStorage.getItem(Keys.SearchFamily)
}
export const removeSearchFamily = () => {
  return sessionStorage.removeItem(Keys.SearchFamily)
}